package com.leetcode.LC;

public class LC1266 {
    public int minTimeToVisitAllPoints(int[][] points) {
        //其实就是算 横竖的最大值
        int sum = 0;
        for (int i = 0; i < points.length - 1; i++) {
            sum += Math.max(Math.abs(points[i + 1][0] - points[i][0]), Math.abs(points[i + 1][1] - points[i][1]));
        }
        return sum;
    }

    public static void main(String[] args) {
        System.out.println(new LC1266().minTimeToVisitAllPoints(new int[][]{{1, 1}, {3, 4}, {-1, 0}}));
    }
}
